$OpenBSD: patch-cmake_modules_FindGStreamer_cmake,v 1.1 2015/09/27 08:23:21 ajacoutot Exp $

https://bugs.freedesktop.org/show_bug.cgi?id=91040

--- cmake/modules/FindGStreamer.cmake.orig	Tue Sep  9 00:13:43 2014
+++ cmake/modules/FindGStreamer.cmake	Sun Sep 27 10:02:48 2015
@@ -2,7 +2,7 @@
 # Once done this will define
 #
 #  GSTREAMER_FOUND - system has GStreamer
-#  GSTREAMER_INCLUDE_DIR - the GStreamer include directory
+#  GSTREAMER_INCLUDE_DIRS - the GStreamer include directories
 #  GSTREAMER_LIBRARIES - the libraries needed to use GStreamer
 #  GSTREAMER_DEFINITIONS - Compiler switches required for using GStreamer
 
@@ -13,12 +13,12 @@
 
 # TODO: Other versions --> GSTREAMER_X_Y_FOUND (Example: GSTREAMER_0_8_FOUND and GSTREAMER_0_10_FOUND etc)
 
-IF (GSTREAMER_INCLUDE_DIR AND GSTREAMER_LIBRARIES AND GSTREAMER_BASE_LIBRARY AND GSTREAMER_INTERFACE_LIBRARY)
+IF (GSTREAMER_INCLUDE_DIRS AND GSTREAMER_LIBRARIES AND GSTREAMER_BASE_LIBRARY AND GSTREAMER_INTERFACE_LIBRARY)
    # in cache already
    SET(GSTREAMER_FIND_QUIETLY TRUE)
-ELSE (GSTREAMER_INCLUDE_DIR AND GSTREAMER_LIBRARIES AND GSTREAMER_BASE_LIBRARY AND GSTREAMER_INTERFACE_LIBRARY)
+ELSE (GSTREAMER_INCLUDE_DIRS AND GSTREAMER_LIBRARIES AND GSTREAMER_BASE_LIBRARY AND GSTREAMER_INTERFACE_LIBRARY)
    SET(GSTREAMER_FIND_QUIETLY FALSE)
-ENDIF (GSTREAMER_INCLUDE_DIR AND GSTREAMER_LIBRARIES AND GSTREAMER_BASE_LIBRARY AND GSTREAMER_INTERFACE_LIBRARY)
+ENDIF (GSTREAMER_INCLUDE_DIRS AND GSTREAMER_LIBRARIES AND GSTREAMER_BASE_LIBRARY AND GSTREAMER_INTERFACE_LIBRARY)
 
 IF (NOT WIN32)
    # use pkg-config to get the directories and then use these values
@@ -31,12 +31,16 @@ IF (NOT WIN32)
    SET(GSTREAMER_DEFINITIONS ${PC_GSTREAMER_CFLAGS_OTHER})
 ENDIF (NOT WIN32)
 
-FIND_PATH(GSTREAMER_INCLUDE_DIR gst/gst.h
-   PATHS
-   ${PC_GSTREAMER_INCLUDEDIR}
-   ${PC_GSTREAMER_INCLUDE_DIRS}
-   PATH_SUFFIXES gstreamer-1.0
-   )
+if (DEFINED PC_GSTREAMER_INCLUDE_DIRS)
+   SET(GSTREAMER_INCLUDE_DIRS ${PC_GSTREAMER_INCLUDE_DIRS})
+ELSE (DEFINED PC_GSTREAMER_INCLUDE_DIRS)
+  FIND_PATH(GSTREAMER_INCLUDE_DIRS gst/gst.h
+     PATHS
+     ${PC_GSTREAMER_INCLUDEDIR}
+     ${PC_GSTREAMER_INCLUDE_DIRS}
+     PATH_SUFFIXES gstreamer-1.0
+     )
+ENDIF (DEFINED PC_GSTREAMER_INCLUDE_DIRS)
 
 FIND_LIBRARY(GSTREAMER_LIBRARIES NAMES gstreamer-1.0
    PATHS
@@ -51,11 +55,11 @@ FIND_LIBRARY(GSTREAMER_BASE_LIBRARY NAMES gstbase-1.0
    )
 
 
-IF (GSTREAMER_INCLUDE_DIR)
-   #MESSAGE(STATUS "DEBUG: Found GStreamer include dir: ${GSTREAMER_INCLUDE_DIR}")
-ELSE (GSTREAMER_INCLUDE_DIR)
-   MESSAGE(STATUS "GStreamer: WARNING: include dir not found")
-ENDIF (GSTREAMER_INCLUDE_DIR)
+IF (GSTREAMER_INCLUDE_DIRS)
+    #MESSAGE(STATUS "DEBUG: Found GStreamer include dir: ${GSTREAMER_INCLUDE_DIRS}")
+ELSE (GSTREAMER_INCLUDE_DIRS)
+   MESSAGE(STATUS "GStreamer: WARNING: include dirs not found")
+ENDIF (GSTREAMER_INCLUDE_DIRS)
 
 IF (GSTREAMER_LIBRARIES)
    #MESSAGE(STATUS "DEBUG: Found GStreamer library: ${GSTREAMER_LIBRARIES}")
@@ -65,6 +69,6 @@ ENDIF (GSTREAMER_LIBRARIES)
 
 
 INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(GStreamer  DEFAULT_MSG  GSTREAMER_LIBRARIES GSTREAMER_INCLUDE_DIR GSTREAMER_BASE_LIBRARY)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(GStreamer  DEFAULT_MSG  GSTREAMER_LIBRARIES GSTREAMER_INCLUDE_DIRS GSTREAMER_BASE_LIBRARY)
 
-MARK_AS_ADVANCED(GSTREAMER_INCLUDE_DIR GSTREAMER_LIBRARIES GSTREAMER_BASE_LIBRARY)
+MARK_AS_ADVANCED(GSTREAMER_INCLUDE_DIRS GSTREAMER_LIBRARIES GSTREAMER_BASE_LIBRARY)
